﻿
@{
    Layout = "";
    ViewBag.MenuId = 3;
}
<style>
    .flayout_e_orderPorInfo {
        position: relative;
    }

    .w_516Go {
        position: absolute;
        font-size: 12px;
        left: 0;
        top: 45px;
        height: 20px;
        padding: 0 8px;
        color: #ed3b3e;
        border: #ed3b3e 1px solid;
        border-radius: 5px;
    }

    .w_56Honour {
        position: absolute;
        top: 45px;
        font-size: 12px;
        color: #ed3b3e;
        left: 0;
        width: 100%;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }
</style>
<div class="flayout_e_content f_mb60" ng-controller="MyActivityListController">
    <div ng-show="reddit.items.length>0" infinite-scroll='reddit.nextPage()' infinite-scroll-disabled='reddit.busy' infinite-scroll-distance='0'>
        <!-- 未中奖订单 -->
        <div class="flayout_e_eachBox flayout_e_winning" ng-repeat="model in reddit.items">
            <div class="flayout_e_eachRow">
                <p class="flayout_e_dp">
                    <img src="/Content/images/f_40.png" alt="店铺图标">
                    <span>优品三悦</span>
                </p>
                <p class="flayout_e_orderState flayout_e_StateToPay">
                    {{model.StateText}}
                </p>
            </div>
            <div class="flayout_e_orderPorbox">
                <a href="javascript:void(0)" ng-click="goinfo(model.StateText,model.ActivityTeamId,model.ActivityId)">
                    <div class="flayout_e_orderPorimg">
                        <img src="{{ImgHostUrl+model.CoverImg}}" alt="产品图">
                    </div>
                    <div class="flayout_e_orderPorInfo">
                        <p class="flayout_e_orderPorName">{{model.ActivityName}}</p>
                        <p class="f_jpts" ng-show="model.StateText=='已中奖'">奖品：{{model.DrawRewardName}}</p>
                        <p class="flayout_e_orderPorPrice">实付款：¥{{model.PaymentAmount}}</p>
                        <img src="/Content/images/f_44.png" alt="未中奖" ng-show="model.StateText=='未中奖'" class="state_img winning_img">
                        <img src="/Content/images/f_43.png" alt="已中奖" ng-show="model.StateText=='已中奖'" class="state_img winning_img">
                        <img src="/Content/images/f_42.png" alt="拼团成功" ng-show="model.StateText=='待抽奖'" class="state_img winning_img">
                        <img src="/Content/images/w_516.png" alt="拼团进行中" ng-show="model.StateText=='拼团中'" class="state_img winning_img">
                        <img src="/Content/images/f_42a.png" alt="组团失败" ng-show="model.StateText=='组团失败'" class="state_img winning_img">
                        @*<p class="w_56Honour" ng-show="model.StateText=='已中奖'">奖品：{{model.DrawRewardName}}</p>*@
                       @* <a href="javascript:void(0)" class="w_516Go" ng-click="godraw(model.LuckDrawID,model.Id)" ng-show="model.StateText=='待抽奖'">去抽奖</a>*@
                    </div>
                </a>
            </div>
            <div class="flayout_f_orderBtns" ng-show="model.StateText=='待抽奖'">
				<a href="javascript:void(0)" class="f_orderBtn" ng-click="godraw(model.LuckDrawID,model.Id)">去抽奖</a>
			</div>
        </div>

    </div>
</div>
<!--end 列表总div -->
<!-- 底部 -->
@Html.Partial("_actfoot")
<!--end 底部 -->
<script>
    App.controller('MyActivityListController', [
           '$scope', '$http', '$rootScope', 'Reddit', '$stateParams', '$state',
       function ($scope, $http, $rootScope, Reddit, $stateParams, $state) {


           $scope.reddit = new Reddit("/Activity/GetMyActivityList", { Take: 5 }, function (response) {
               debugger;
           });


           $scope.goinfo = function (text, id, activityid) {
               if (text == "拼团中") {
                   $state.go('activity.activityteaminfo', { Id: id });
               }
               //else {
               //    $state.go('activity.activityinfo', { Id: activityid });
               //}
           }

           $scope.godraw = function (drawId, tId) {
               $state.go('draw.index', { drawId: drawId, tId: tId });
           }
           var tt = function () {
               $rootScope.WxShare($rootScope.pageTitle(), '优品三悦', location.href, $rootScope.LogoUrl);
           }

           setTimeout(tt, 1000)

       }]);
</script>